<template>
  <view class="contents">
    <view class="control">
      <view class="uni-padding-wrap uni-common-mt">
        <uni-segmented-control
          :current="current"
          :values="items"
          style-type="button"
          :active-color="activeColor"
          @clickItem="onClickItem"
        />
      </view>
    </view>
    <view class="content" >
        <cardList :current="current"/>
      </view>
    </view>
  </view>
</template>

<script>
import cardList from "@/pages/tabbar/warn/cardList.vue"
import navBar from "@/components/navbar/index.vue"
export default {
  components: {
    navBar,
    cardList,
  },
  data() {
    return {
      items: ["全部", "发生中", "已恢复"],
      current: 0,
      activeColor: "#007aff",
    }
  },
  methods: {
    onLeftIcon() {},
    onClickItem(e) {
      if (this.current !== e.currentIndex) {
        this.current = e.currentIndex
      }
    },
  },
}
</script>

<style scoped lang="scss">
.control {
  margin: 0 auto;
  width: 80%;
  margin-top: 20rpx;
  background-color: #fff;
}
</style>
